package net.bwie.udf;

import ch.hsr.geohash.GeoHash;
import org.apache.hadoop.hive.ql.exec.UDF;

/**
 * 简介说明:
 *
 * @author: LiLi
 * @date: 2025/04/17 22:21:44
 * @version: 1.0
 */
public class con_geohash extends UDF {
    public String evaluate(Double lat,Double lng,int pre){
        GeoHash geoHash = GeoHash.withCharacterPrecision(lat, lng, pre);
        return geoHash.toBase32();
    }

    public static void main(String[] args) {
        System.out.println(new convert_geohash().evaluate(40.56625604385062,116.43172021641325,6));
    }
}
